package com.rc.evcharger.service.tenant;

import com.rc.evcharger.mapper.tenant.TenantManufacturerMapper;
import com.rc.evcharger.model.tenant.TenantManufacturer;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * Created by sven on 2019/09/23.
 */
@Service
public class TenantManufacturerServiceImpl implements TenantManufacturerService {

    @Autowired
    private TenantManufacturerMapper tenantManufacturerMapper;

    @Override
    public TenantManufacturerMapper getMapper() {
        return tenantManufacturerMapper;
    }

    /**
     * 判断是否为新亚桩
     */
    @Override
    public boolean isManufacturerCodeByEpId(String manufacturerCode, Long manuFacutreId) {

        if (manuFacutreId == null) {
            return false;
        }

        TenantManufacturer tenantManufacturer = tenantManufacturerMapper.selectByPrimaryKey(manuFacutreId);
        if (manufacturerCode.equals(tenantManufacturer.getLicense())) {
            return true;
        }

        return false;
    }
}
